numlen = int(input())
line = input()
numbers = list(map(int, line.split()))

count = 0
for num in numbers:
    num = str(num)
    for c in num:
        if c != '0':
            count += 1
print(count)